home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
BARNET
/
COMPILER
/
SATHER
/
!Sather
/
Library
/
Containrs
/
sa
/
list
< prev
next >
Wrap
Text File
|
1996-09-05
|
2KB
|
61 lines
---------------------------> Sather 1.1 source file <--------------------------
-- list.sa: Extensible array
-- Author: Benedict A. Gomes <gomes@samosa.ICSI.Berkeley.EDU>
-- Copyright (C) 1995, International Computer Science Institute
-- $Id: list.sa,v 1.7 1996/09/05 00:03:43 borisv Exp $
--
-- COPYRIGHT NOTICE: This code is provided WITHOUT ANY WARRANTY
-- and is subject to the terms of the SATHER LIBRARY GENERAL PUBLIC
-- LICENSE contained in the file: Sather/Doc/License of the
-- Sather distribution. The license is also available from ICSI,
-- 1947 Center St., Suite 600, Berkeley CA 94704, USA.
-------------------------------------------------------------------
abstract class $LIST{ETP} < $ARR{ETP}, $STR is
-- An extensible array abstraction. Similar to a list abstraction,
-- but keys are integers after an insert all other keys may have
-- changed
-- Inherits:
-- size: INT;
-- aget(i: INT): ETP
-- aset(ind: INT, e: ETP)
-- has_ind(i: INT): BOOL;
-- elt!: ETP;
-- ind!: INT
-- set_view: $RO_SET{ETP};
-- ------ Initialization/Duplication ------
copy: SAME;
-- Redefined to narrow the return type
-- ------ Insertion/Removal ---------------
insert_after(ind: INT, val: ETP);
-- pre valid_ind(ind) post valid_ind(result);
-- Insert the value "val" after the index "ind" in the list
-- The indices of all subseqeuent elements will be shifted up by 1
insert_before(ind: INT,val: ETP);
-- Insert the value "val" before the index "ind" in the list
-- The indices of all subsequent elements will be shifted upward
insert_all_before(ind: INT, val: $CONTAINER{ETP});
-- Insert the elements of "val" in order, before "ind"
-- The indices of all subsequent elements will be shifted upward
insert_all_after(ind: INT, val: $CONTAINER{ETP});
-- Insert the elements of the list in order after "ind"
-- The indices of all subsequent elements will be shifted upward
append(e: ETP);
-- Concatenate "e" onto the end of the array
append_all(l: $CONTAINER{ETP});
-- post has(l.elt!)
-- Append the elements of "l" onto the end of the current array
equals(a: $RO_ARR{ETP}): BOOL;
end; -- class $LIST{ETP}
--=============================================================================